<template>
  <div class="welcome">
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span>工作台</span>
          <el-tag>{{day}}</el-tag>
          <!-- <el-button class="button" text>Operation button</el-button> -->
        </div>
      </template>
      <div class="box-content">
        <div class="left">
          <el-avatar :size="50"
                     src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
          <div class="welcome-content">
            <span>您好,{{$store.state.userInfo.userName}},逆流而上的你,是值得拥有最好的!</span>
            <span>欢迎使用企业人事管理系统</span>
          </div>
        </div>
        <div class="right">
          <div class="today">
            <span>{{day === '星期六' || day === '星期天' ? '今天是休息日': '今天是工作日'}}</span>
          </div>
          <div class="day">
            您已经上班<el-tag size="small"
                    style="margin:0 7px;">{{time}}</el-tag>天
          </div>
        </div>

      </div>
    </el-card>
    <!-- <div class="box2"> -->

    <el-row :gutter="10"
            style="margin-top:15px">
      <el-col :span="6">
        <el-card>
          <echart-one class="one"></echart-one>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card>
          <echart-two class="two"></echart-two>
        </el-card>
      </el-col>
      <el-col :span="12">
        <el-card>
          <echart-three class="two"></echart-three>
        </el-card>
      </el-col>
      <el-col style="margin-top:15px;">
        <echart-four class="four"></echart-four>
      </el-col>
    </el-row>

    <!-- </div> -->

    <!-- <div class="content">
            <div class="sub-title">欢迎体验</div>
            <div class="title">企业人事通用后台管理系统</div>
            <div class="desc">
                - Vue+Element+Node+Mongo打造通用后台管理系统
            </div>
        </div>
        <div class="img"></div> -->
  </div>
</template>

<script>
import EchartOne from '../components/EchartOne.vue'
import EchartTwo from '../components/EchartTwo.vue'
import EchartThree from '../components/EchartThree.vue'
import EchartFour from '../components/EchartFour.vue'
import 'dayjs/locale/es'
export default {
  name: "welcome",
  components: {
    EchartOne,
    EchartTwo,
    EchartThree,
    EchartFour
  },
  data() {
    return {
      day: '',
      time: 0,
    }
  },
  mounted() {
    this.day = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'][dayjs().day() - 1];
    this.time = dayjs().diff(dayjs(this.$store.state.userInfo.createTime), 'day') + 1

  },

};
</script>

<style lang="scss">
.card-header {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.left {
  display: flex;
  align-items: center;
}

.right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  .today {
    font-size: 14px;
    color: #e2610b;
    margin-bottom: 10px;
  }
}

.box-content {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .welcome-content {
    margin-left: 5px;
    display: flex;
    flex-direction: column;

    span:nth-of-type(1) {
      font-weight: 600;
      letter-spacing: 0.8px;
      margin-bottom: 12px;
    }

    span:nth-of-type(2) {
      font-size: 12px;
      font-weight: 600;
      color: rgb(146, 141, 141);
    }
  }
}

.one {
  height: 200px;
}

.two {
  height: 200px;
}

.four {
  height: 300px;
}

// .box-card {
//     width: 480px;
// }

// .welcome {
//     display: flex;
//     justify-content: center;
//     align-items: center;
//     height: 732px;
//     background-color: #fff;

//     .content {
//         position: relative;
//         bottom: 40px;

//         .sub-title {
//             font-size: 30px;
//             line-height: 42px;
//             color: #333;
//         }

//         .title {
//             font-size: 40px;
//             line-height: 62px;
//             color: #409eff;
//         }

//         .desc {
//             text-align: right;
//             font-size: 14px;
//             color: #999;
//         }
//     }

//     .img {
//         margin-left: 105px;
//         background-image: url("./../assets/images/welcome.png");
//         width: 371px;
//         height: 438px;
//     }
// }
</style>